<p class="Paragraph">If the program encounters a While statement, it tests the condition. If the condition is False, the program continues directly following the Wend statement. If the condition is True, the loop is executed until the program finds Wend and then jumps back to the <span style="font-weight:bold;"><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>While </span><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>statement. If the condition is still True, the loop will be executed again; otherwise the program continues with the statement following the <span style="font-weight:bold;"><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>Wend </span><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>statement.</p>
</help:to-be-embedded>
<p class="Paragraph">Opposed to <help:link Id="66463" Eid="doloop" xmlns:help="http://openoffice.org/2000/help">Do...Loop</help:link>, a <span class="T1"><text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>While...Wend</span> loop cannot be canceled with <help:link Id="66590" Eid="exit" xmlns:help="http://openoffice.org/2000/help">Exit</help:link>. You should never exit a <span class="T1">While...Wend</span> loop with <help:link Id="66534" Eid="goto" xmlns:help="http://openoffice.org/2000/help">GoTo</help:link>, since this can cause a runtime error.</p>
<p class="Paragraph">Use of <span class="T1">Do...Loop</span> is more flexible and is therefore recommended.</p>